package com.yanqu.road.entity.activity.operamask;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.entity.DataStatus;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@FieldTypeAnnotation(tableName = "t_u_opera_mask_user_data")
public class OperaMaskUserData extends DataObject {

    @FieldTypeAnnotation(desc = "活动ID", select = true, update = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "玩家ID", select = true, update = true)
    private long userId;
    @FieldTypeAnnotation(desc = "唱功等级")
    private int singLevel = 1;
    @FieldTypeAnnotation(desc = "每日免费次数")
    private int energy;
    @FieldTypeAnnotation(desc = "每日免费次数重置时间")
    private long recoveryTime;
    @FieldTypeAnnotation(desc = "游戏数据")
    private OperaMaskGameData gameData;
    @FieldTypeAnnotation(desc = "剧目数据")
    private Map<Integer, OperaMaskSceneData> sceneDataMap = new ConcurrentHashMap<>();
    @FieldTypeAnnotation(desc = "最高技能")
    private Map<Integer, Integer> skillMaxLevelMap = new ConcurrentHashMap<>();

    @FieldTypeAnnotation(desc = "总局数")
    private int sumEnergy;

    @FieldTypeAnnotation(desc = "战令，1白银，2黄金")
    private List<Integer> tokenList = new ArrayList<>();

    // ===================================

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        if (this.activityId != activityId) {
            this.activityId = activityId;
            setOp(DataStatus.Update);
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if (this.userId != userId) {
            this.userId = userId;
            setOp(DataStatus.Update);
        }
    }

    public int getSingLevel() {
        return singLevel;
    }

    public void setSingLevel(int singLevel) {
        if (this.singLevel != singLevel) {
            this.singLevel = singLevel;
            setOp(DataStatus.Update);
        }
    }

    public int getEnergy() {
        return energy;
    }

    public void setEnergy(int energy) {
        if (this.energy != energy) {
            this.energy = energy;
            setOp(DataStatus.Update);
        }
    }

    public long getRecoveryTime() {
        return recoveryTime;
    }

    public void setRecoveryTime(long recoveryTime) {
        if (this.recoveryTime != recoveryTime) {
            this.recoveryTime = recoveryTime;
            setOp(DataStatus.Update);
        }
    }

    public OperaMaskGameData getGameData() {
        return gameData;
    }

    public void setGameData(OperaMaskGameData gameData) {
        this.gameData = gameData;
        setOp(DataStatus.Update);
    }

    public Map<Integer, OperaMaskSceneData> getSceneDataMap() {
        return sceneDataMap;
    }

    public void setSceneDataMap(Map<Integer, OperaMaskSceneData> sceneDataMap) {
        if (null == sceneDataMap) {
            return;
        }
        this.sceneDataMap = sceneDataMap;
        setOp(DataStatus.Update);
    }

    public Map<Integer, Integer> getSkillMaxLevelMap() {
        return skillMaxLevelMap;
    }

    public void setSkillMaxLevelMap(Map<Integer, Integer> skillMaxLevelMap) {
        if (null == skillMaxLevelMap) {
            return;
        }
        this.skillMaxLevelMap = skillMaxLevelMap;
        setOp(DataStatus.Update);
    }

    public int getSumEnergy() {
        return sumEnergy;
    }

    public void setSumEnergy(int sumEnergy) {
        if (this.sumEnergy != sumEnergy) {
            this.sumEnergy = sumEnergy;
            setUpdateOption();
        }
    }

    public List<Integer> getTokenList() {
        return tokenList;
    }

    public void setTokenList(List<Integer> tokenList) {
        this.tokenList = tokenList;
        setUpdateOption();
    }
}
